package E2020;

public class Exam3 implements Runnable{
    int a = 1;
    @Override
    public void run() {
        for (int i=1;i<=5;i++){
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+":"+a++);
            //a++;
        }
    }
    public static void main(String[] args) {
        Exam3 e = new Exam3();
        for (int i=1;i<=3;i++){

                Thread thread = new Thread(e);
                thread.setName("Thread"+i);
                thread.start();
        }
    }
}